import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_study_app/module/statistics/page/cross_recommend_statistics_page.dart';
import 'package:flutter_study_app/module/statistics/widget/tab_app_bar.dart';

import 'visit_statistics_page.dart';

class DataStatisticsPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _DataStatisticsState();
}

class _DataStatisticsState extends State with SingleTickerProviderStateMixin {
  late TabController _tabController;

  @override
  void initState() {
    super.initState();
    _tabController = new TabController(vsync: this, length: 3);
  }

  @override
  void dispose() {
    _tabController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: TabAppBar(
        tabs: [Text('走访统计'), Text('交叉引荐'), Text('引流统计')],
        tabController: _tabController,
      ),
      body: TabBarView(
        controller: _tabController,
        physics: NeverScrollableScrollPhysics(),
        children: [
          VisitStatisticsPage(),
          CrossRecommendStatisticsPage(),
          Center(
            child: Text('Page03'),
          )
        ],
      ),
    );
  }
}
